using UniversalAdmin.Shared.Enums;

namespace UniversalAdmin.Domain.Entities;

    //用户实体类
    public class User : BaseEntity
    {
    
        public string Username {get;set;} = string.Empty; //string.Empyt 表示返回一个空字符串
        public string Email {get;set;} = string.Empty; //邮箱
        public string PasswordHash {get;set;} = string.Empty; //明文密码一般不定义在任何的实体中但是Hash密码可以定义
         public string PasswordSalt { get; set; } = string.Empty; // 密码盐
        public UserStatus Status {get;set;} = UserStatus.Active; //枚举类型的用户状态开关
        public DateTime LastLoginAt {get;set;} = DateTime.Now; //最后登录时间

        // 用户角色导航属性
        public virtual List<Role> Roles {get;set;} = new();

    }


